import {createServer} from 'http';
import config from './config'
import {app} from './app';
import {sequelize} from './db';

const port = config.port || 5000;

(async () => {
  console.log(' --- 数据库执行 ----');
  await sequelize.sync({
    force: false
    // true代表删除表
    // false代表不删除原表
  });

  createServer(app)
    .listen(port, () => console.log(`Server listen on port ${port}`));
})();

